# -*- coding: utf-8 -*- 
#
# Description:
#
#  Definiton
#
#
#
# Changes:
#
# 2012-01-10
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 (polo35580@hotmail.fr)
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

nname: 27
n 27(None)[return u'%s\u2026' % s[:maxlen - 1]
]:
	i: 18(), 26()
	o: 

nname: 26
n 26(None)[]:
	i: 0(f)
	o: 27()

nname: 18
n 18(None)[return s
]:
	i: 0(t)
	o: 27()

nname: 0
n 0(len(s) <= maxlen)[]:
	i: 
	o: 18(t), 26(f)

nname: 0
n 0(None)[if len(s) <= maxlen:
	return s
return u'%s\u2026' % s[:maxlen - 1]
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb768576c>}
nname: 68
n 68(None)[return '%.1f%sB' % (filesize, unit)
]:
	i: 0(AL), 67()
	o: 

nname: 67
n 67(None)[]:
	i: 15(AF), 63()
	o: 68()

nname: 63
n 63(None)[]:
	i: 22(f), 43()
	o: 67()

nname: 43
n 43(None)[filesize /= 1024.0
unit = dec
continue
]:
	i: 22(t)
	o: 63()

nname: 22
n 22(abs(filesize) > 1100.0)[for dec in decimators:
]:
	i: 15(for)
	o: 43(t), 63(f)

nname: 15
n 15(None)[]:
	i: 0(loop)
	o: 22(for), 67(AF)

nname: 0
n 0(None)[decimators = ('k', 'M', 'G', 'T')
unit = ''
]:
	i: 
	o: 15(loop), 68(AL)

nname: 68
n 68(None)[return '%.1f%sB' % (filesize, unit)
]:
	i: 0(AL), 15(AF), 22()
	o: 

nname: 22
n 22(None)[for dec in decimators:
if abs(filesize) > 1100.0:
	filesize /= 1024.0
	unit = dec
	continue
]:
	i: 15(for)
	o: 68()

nname: 15
n 15(None)[]:
	i: 0(loop)
	o: 22(for), 68(AF)

nname: 0
n 0(None)[decimators = ('k', 'M', 'G', 'T')
unit = ''
]:
	i: 
	o: 15(loop), 68(AL)

nname: 22
n 22(None)[for dec in decimators:
	if abs(filesize) > 1100.0:
		filesize /= 1024.0
		unit = dec
		continue
return '%.1f%sB' % (filesize, unit)
]:
	i: 0(for)
	o: 

nname: 0
n 0(None)[decimators = ('k', 'M', 'G', 'T')
unit = ''
]:
	i: 
	o: 22(for)

nname: 0
n 0(None)[decimators = ('k', 'M', 'G', 'T')
unit = ''
for dec in decimators:
	if abs(filesize) > 1100.0:
		filesize /= 1024.0
		unit = dec
		continue
return '%.1f%sB' % (filesize, unit)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb768562c>}
nname: 68
n 68(None)[return '%.1f%sb' % (rate, unit)
]:
	i: 0(AL), 67()
	o: 

nname: 67
n 67(None)[]:
	i: 15(AF), 63()
	o: 68()

nname: 63
n 63(None)[]:
	i: 22(f), 43()
	o: 67()

nname: 43
n 43(None)[rate /= 1024.0
unit = dec
continue
]:
	i: 22(t)
	o: 63()

nname: 22
n 22(abs(rate) > 1100.0)[for dec in decimators:
]:
	i: 15(for)
	o: 43(t), 63(f)

nname: 15
n 15(None)[]:
	i: 0(loop)
	o: 22(for), 67(AF)

nname: 0
n 0(None)[decimators = ('k', 'M', 'G', 'T')
unit = ''
]:
	i: 
	o: 15(loop), 68(AL)

nname: 68
n 68(None)[return '%.1f%sb' % (rate, unit)
]:
	i: 0(AL), 15(AF), 22()
	o: 

nname: 22
n 22(None)[for dec in decimators:
if abs(rate) > 1100.0:
	rate /= 1024.0
	unit = dec
	continue
]:
	i: 15(for)
	o: 68()

nname: 15
n 15(None)[]:
	i: 0(loop)
	o: 22(for), 68(AF)

nname: 0
n 0(None)[decimators = ('k', 'M', 'G', 'T')
unit = ''
]:
	i: 
	o: 15(loop), 68(AL)

nname: 22
n 22(None)[for dec in decimators:
	if abs(rate) > 1100.0:
		rate /= 1024.0
		unit = dec
		continue
return '%.1f%sb' % (rate, unit)
]:
	i: 0(for)
	o: 

nname: 0
n 0(None)[decimators = ('k', 'M', 'G', 'T')
unit = ''
]:
	i: 
	o: 22(for)

nname: 0
n 0(None)[decimators = ('k', 'M', 'G', 'T')
unit = ''
for dec in decimators:
	if abs(rate) > 1100.0:
		rate /= 1024.0
		unit = dec
		continue
return '%.1f%sb' % (rate, unit)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7685ccc>}
nname: 0
n 0(None)[return time.strftime('%H:%M', time.localtime(t + 30))
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb768588c>}
nname: 0
n 0(None)[return time.strftime('%H:%M:%S', time.localtime(t))
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb768576c>}
nname: 0
n 0(None)[return time.strftime('%M:%S', time.localtime(t))
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb768556c>}
nname: 0
n 0(None)[minutes, seconds = divmod(t + 30, 60)
return '%02i:%02i' % divmod(minutes, 60)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7685ccc>}
nname: 0
n 0(None)[minutes, seconds = divmod(t, 60)
hours, minutes = divmod(minutes, 60)
return '%02i:%02i:%02i' % (hours, minutes, seconds)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb768564c>}
nname: 0
n 0(None)[return '%02i:%02i' % divmod(t, 60)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb768596c>}
nname: 0
n 0(None)[return src.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;').replace('\n', '<\n>').replace('\\n', '<\n>').replace('\t', '    ')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7685eec>}
nname: 0
n 0(None)[return '%02d%%' % int(n)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76858cc>}
nname: 50
n 50(None)[return int(n.strip().strip('%'))
]:
	i: 0&12(t), 25()
	o: 

nname: 25
n 25(None)[]:
	i: 0&12(f)
	o: 50()

nname: 0&12
n 0&12(n.isdigit() and int(n))[]:
	i: 
	o: 25(f), 50(t)

nname: 0&12
n 0&12(None)[if not(n.isdigit() and int(n)):
	pass
return int(n.strip().strip('%'))
]:
	i: 
	o: 

self.nodes: {'0&12': <unpyclib.structure.node instance at 0xb7685eec>}
nname: 0
n 0(None)[return string.lower() in _TRUTH_VALUES
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb768534c>}
nname: 0
n 0(None)[return int(string.lower() in _TRUTH_VALUES)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76853ec>}
nname: 0
n 0(None)[return tuple(<genexpr>(string.split(',')))
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb768588c>}
nname: 0
n 0(None)[return tuple(<genexpr>(string.split()))
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7685e6c>}
nname: 0
n 0(None)[return tuple(<genexpr>(string.split(',')))
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7685d0c>}
nname: 0
n 0(None)[return '<%s>%s</>' % (tag, value)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb768576c>}
nname: 29
n 29(None)[return int(att)
]:
	i: 0&12(t), 19()
	o: 

nname: 19
n 19(None)[]:
	i: 0&12(f)
	o: 29()

nname: 0&12
n 0&12('%' in att and att)[]:
	i: 
	o: 19(f), 29(t)

nname: 0&12
n 0&12(None)[if not('%' in att and att):
	pass
return int(att)
]:
	i: 
	o: 

self.nodes: {'0&12': <unpyclib.structure.node instance at 0xb7685d0c>}
nname: 0
n 0(None)[from __future__ import absolute_import
__all__ = ['bytes_to_human', 'bits_to_human', 'seconds_to_hhmm', 'seconds_to_hhmmss', 'seconds_to_mmss', 'seconds_to_hhmm_utc', 'seconds_to_mmss_utc', 'seconds_to_hhmmss_utc', 'ellipsize', 'html_format', 'tab_to_spaces', 'int_to_percent', 'percent_to_int', 'boolean', 'boolean_to_int', 'int_tuple', 'int_tuple_list', 'string_tuple', 'string_or_float']
import time
def ellipsize(s, maxlen):
	if len(s) <= maxlen:
		return s
	return u'%s\u2026' % s[:maxlen - 1]

def bytes_to_human(filesize):
	decimators = ('k', 'M', 'G', 'T')
	unit = ''
	for dec in decimators:
		if abs(filesize) > 1100.0:
			filesize /= 1024.0
			unit = dec
			continue
	return '%.1f%sB' % (filesize, unit)

def bits_to_human(rate):
	decimators = ('k', 'M', 'G', 'T')
	unit = ''
	for dec in decimators:
		if abs(rate) > 1100.0:
			rate /= 1024.0
			unit = dec
			continue
	return '%.1f%sb' % (rate, unit)

def seconds_to_hhmm(t):
	return time.strftime('%H:%M', time.localtime(t + 30))

def seconds_to_hhmmss(t):
	return time.strftime('%H:%M:%S', time.localtime(t))

def seconds_to_mmss(t):
	return time.strftime('%M:%S', time.localtime(t))

def seconds_to_hhmm_utc(t):
	minutes, seconds = divmod(t + 30, 60)
	return '%02i:%02i' % divmod(minutes, 60)

def seconds_to_hhmmss_utc(t):
	minutes, seconds = divmod(t, 60)
	hours, minutes = divmod(minutes, 60)
	return '%02i:%02i:%02i' % (hours, minutes, seconds)

def seconds_to_mmss_utc(t):
	return '%02i:%02i' % divmod(t, 60)

def html_format(src):
	return src.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;').replace('\n', '<\n>').replace('\\n', '<\n>').replace('\t', '    ')

def int_to_percent(n):
	return '%02d%%' % int(n)

def percent_to_int(n):
	if not(n.isdigit() and int(n)):
		pass
	return int(n.strip().strip('%'))

_TRUTH_VALUES = frozenset(('true', 'vrai', 'ok', 'yes', 'on', '1'))
def boolean(string):
	return string.lower() in _TRUTH_VALUES

def boolean_to_int(string):
	return int(string.lower() in _TRUTH_VALUES)

def int_tuple(string):
	return tuple(<genexpr>(string.split(',')))

def int_tuple_list(string):
	return tuple(<genexpr>(string.split()))

def string_tuple(string):
	return tuple(<genexpr>(string.split(',')))

def xml_tag(tag, value=''):
	return '<%s>%s</>' % (tag, value)

def string_or_float(att):
	if not('%' in att and att):
		pass
	return int(att)

]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb767b4cc>}
from __future__ import absolute_import
__all__ = ['bytes_to_human', 'bits_to_human', 'seconds_to_hhmm', 'seconds_to_hhmmss', 'seconds_to_mmss', 'seconds_to_hhmm_utc', 'seconds_to_mmss_utc', 'seconds_to_hhmmss_utc', 'ellipsize', 'html_format', 'tab_to_spaces', 'int_to_percent', 'percent_to_int', 'boolean', 'boolean_to_int', 'int_tuple', 'int_tuple_list', 'string_tuple', 'string_or_float']
import time
def ellipsize(s, maxlen):
	if len(s) <= maxlen:
		return s
	return u'%s\u2026' % s[:maxlen - 1]

def bytes_to_human(filesize):
	decimators = ('k', 'M', 'G', 'T')
	unit = ''
	for dec in decimators:
		if abs(filesize) > 1100.0:
			filesize /= 1024.0
			unit = dec
			continue
	return '%.1f%sB' % (filesize, unit)

def bits_to_human(rate):
	decimators = ('k', 'M', 'G', 'T')
	unit = ''
	for dec in decimators:
		if abs(rate) > 1100.0:
			rate /= 1024.0
			unit = dec
			continue
	return '%.1f%sb' % (rate, unit)

def seconds_to_hhmm(t):
	return time.strftime('%H:%M', time.localtime(t + 30))

def seconds_to_hhmmss(t):
	return time.strftime('%H:%M:%S', time.localtime(t))

def seconds_to_mmss(t):
	return time.strftime('%M:%S', time.localtime(t))

def seconds_to_hhmm_utc(t):
	minutes, seconds = divmod(t + 30, 60)
	return '%02i:%02i' % divmod(minutes, 60)

def seconds_to_hhmmss_utc(t):
	minutes, seconds = divmod(t, 60)
	hours, minutes = divmod(minutes, 60)
	return '%02i:%02i:%02i' % (hours, minutes, seconds)

def seconds_to_mmss_utc(t):
	return '%02i:%02i' % divmod(t, 60)

def html_format(src):
	return src.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;').replace('\n', '<\n>').replace('\\n', '<\n>').replace('\t', '    ')

def int_to_percent(n):
	return '%02d%%' % int(n)

def percent_to_int(n):
	if not(n.isdigit() and int(n)):
		pass
	return int(n.strip().strip('%'))

_TRUTH_VALUES = frozenset(('true', 'vrai', 'ok', 'yes', 'on', '1'))
def boolean(string):
	return string.lower() in _TRUTH_VALUES

def boolean_to_int(string):
	return int(string.lower() in _TRUTH_VALUES)

def int_tuple(string):
	return tuple(<genexpr>(string.split(',')))

def int_tuple_list(string):
	return tuple(<genexpr>(string.split()))

def string_tuple(string):
	return tuple(<genexpr>(string.split(',')))

def xml_tag(tag, value=''):
	return '<%s>%s</>' % (tag, value)

def string_or_float(att):
	if not('%' in att and att):
		pass
	return int(att)

